#pragma once
#include"google/protobuf/service.h"

#include<unordered_map>
#include<memory>
#include"reactor.h"
#include"mainServer.h"
#include<google/protobuf/descriptor.h>
#include<google/protobuf/service.h>

 struct ServiceInfo
 {
         google::protobuf::Service * service;
         std::unordered_map<std::string,const google::protobuf::MethodDescriptor*> m_methodMap;
  };
class RpcProvider
{
public:
     void NotifyService(google::protobuf::Service * service);
     void Run();
     static  std::unordered_map<std::string,struct ServiceInfo> & GetServiceMap()
     {
         return m_serviceMap;
     }
private:
      
       static std::unordered_map<std::string,struct ServiceInfo> m_serviceMap;
       MainServer m_Server;
       std::unique_ptr<Reactor> * m_reacotr;
     
};